home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / DHTML - Scrollers / news-updater.izs < prev    next >
Text File  |  2005-09-02  |  5KB  |  220 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>News Updater Script
  4. <!/TITLE>
  5.  
  6. <!BROWSER>IE5+<!/BROWSER>
  7.  
  8. <!DESCRIPTION> A "news updater" that rotates among different messages. Infinite number of messages can be added to the updater. This script uses a special mechanism to dynamically determine the height of the longest message, and sets itself to match this height. Browsers other than IE 4.x will simply see nothing. 
  9. <!/DESCRIPTION> 
  10.  
  11. <!CATEGORY>scrollers<!/CATEGORY>
  12.  
  13. <!SCRIPT>
  14. <!-- START OF SCRIPT -->
  15. <!-- Step 1: Copy the below into the <head> section of your web page: -->
  16. <script>
  17. <!--
  18. function correct(){
  19. if (finished){
  20. setTimeout("begin()",3000)
  21. }
  22. return true
  23. }
  24. window.onerror=correct
  25. function begin(){
  26. if (!document.all)
  27. return
  28. if (maxheight==null)
  29. maxheight=temp.offsetHeight
  30. whatsnew.style.height=maxheight
  31. temp.style.display="none"
  32. c=1
  33. finished=true
  34. change()
  35. }
  36. //-->
  37. </script>
  38.  
  39. <style>
  40. <!--
  41. #whatsnew a{color:730073;text-decoration:none}
  42. #whatsnew, #temp {font-weight:bold; font-family:Arial}
  43. #whatsnew a:hover{color:red}
  44. -->
  45. </style>
  46. <!-- Step 2: Copy the below into the <body> section of your web page (preferably inside a table column that has its width specified, ie 230, or 25%): -->
  47. <script language="javascript1.2">
  48. <!--
  49.  
  50. /*
  51. News Updater Script- 
  52. ⌐ Dynamic Drive (www.dynamicdrive.com)
  53. For full source code, installation instructions,
  54. 100's more DHTML scripts, and Terms Of
  55. Use, visit dynamicdrive.com
  56. */
  57.  
  58. var head=''
  59. var top=0
  60. var maxheight
  61. var finished=false
  62. var tickers=new Array()
  63.  
  64. tickers[0]='<a href="0.htm">This is message 0</a>'
  65.  
  66. tickers[1]='<a href="1.htm">This is message 1</a>'
  67.  
  68. tickers[2]='<a href="2.htm">This is message 2.</a>'
  69.  
  70. tickers[3]='<a href="3.htm">This is message 3.</a>'
  71.  
  72. tickers[4]='<a href="4.htm">This is message 4.</a>'
  73.  
  74. for (i=1;i<=tickers.length-1;i++){
  75. if (tickers[i].length>=tickers[top].length)
  76. top=i
  77. }
  78. if (document.all)
  79. document.write('<span id="whatsnew" style="width:100%;height=10;filter:revealTrans(duration=2,transition=19)">'+tickers[0]+'</span>')
  80.  
  81. function change(){
  82. whatsnew.innerHTML=''
  83. whatsnew.filters.revealTrans.apply()
  84. whatsnew.filters.revealTrans.play()
  85. whatsnew.innerHTML=tickers[c]
  86. if (c==tickers.length-1) 
  87. c=0
  88. else
  89. c+=1
  90. setTimeout("change()",5000)
  91. }
  92. if (document.all)
  93. document.write('<span id=ns style="display:none;">')
  94. //-->
  95. </script>
  96. <!--Insert alternate HTML codes here
  97. that will be seen by browsers OTHER 
  98. than IE 4.x-->
  99. </span>
  100.  
  101. <span id=temp style="position:absolute;left:0;top:0" style=&{head};>
  102. <script>
  103. <!--
  104. if (document.all){
  105. temp.style.width=whatsnew.style.width
  106. document.write(tickers[top])
  107. }
  108. //-->
  109. </script>
  110. </span><br>
  111. <!-- Step 3: Finally, add the below into the <body> tag itself, like this: -->
  112. <body onLoad="begin()">
  113. <!-- END OF SCRIPT -->
  114. <!/SCRIPT>
  115.  
  116. <!PREVIEW>
  117. <!-- START OF SCRIPT -->
  118. <!-- Step 1: Copy the below into the <head> section of your web page: -->
  119. <script>
  120. <!--
  121. function correct(){
  122. if (finished){
  123. setTimeout("begin()",3000)
  124. }
  125. return true
  126. }
  127. window.onerror=correct
  128. function begin(){
  129. if (!document.all)
  130. return
  131. if (maxheight==null)
  132. maxheight=temp.offsetHeight
  133. whatsnew.style.height=maxheight
  134. temp.style.display="none"
  135. c=1
  136. finished=true
  137. change()
  138. }
  139. //-->
  140. </script>
  141.  
  142. <style>
  143. <!--
  144. #whatsnew a{color:730073;text-decoration:none}
  145. #whatsnew, #temp {font-weight:bold; font-family:Arial}
  146. #whatsnew a:hover{color:red}
  147. -->
  148. </style>
  149. <!-- Step 2: Copy the below into the <body> section of your web page (preferably inside a table column that has its width specified, ie 230, or 25%): -->
  150. <script language="javascript1.2">
  151. <!--
  152.  
  153. /*
  154. News Updater Script- 
  155. ⌐ Dynamic Drive (www.dynamicdrive.com)
  156. For full source code, installation instructions,
  157. 100's more DHTML scripts, and Terms Of
  158. Use, visit dynamicdrive.com
  159. */
  160.  
  161. var head=''
  162. var top=0
  163. var maxheight
  164. var finished=false
  165. var tickers=new Array()
  166.  
  167. tickers[0]='<a href="0.htm">This is message 0</a>'
  168.  
  169. tickers[1]='<a href="1.htm">This is message 1</a>'
  170.  
  171. tickers[2]='<a href="2.htm">This is message 2.</a>'
  172.  
  173. tickers[3]='<a href="3.htm">This is message 3.</a>'
  174.  
  175. tickers[4]='<a href="4.htm">This is message 4.</a>'
  176.  
  177. for (i=1;i<=tickers.length-1;i++){
  178. if (tickers[i].length>=tickers[top].length)
  179. top=i
  180. }
  181. if (document.all)
  182. document.write('<span id="whatsnew" style="width:100%;height=10;filter:revealTrans(duration=2,transition=19)">'+tickers[0]+'</span>')
  183.  
  184. function change(){
  185. whatsnew.innerHTML=''
  186. whatsnew.filters.revealTrans.apply()
  187. whatsnew.filters.revealTrans.play()
  188. whatsnew.innerHTML=tickers[c]
  189. if (c==tickers.length-1) 
  190. c=0
  191. else
  192. c+=1
  193. setTimeout("change()",5000)
  194. }
  195. if (document.all)
  196. document.write('<span id=ns style="display:none;">')
  197. //-->
  198. </script>
  199. <!--Insert alternate HTML codes here
  200. that will be seen by browsers OTHER 
  201. than IE 4.x-->
  202. </span>
  203.  
  204. <span id=temp style="position:absolute;left:0;top:0" style=&{head};>
  205. <script>
  206. <!--
  207. if (document.all){
  208. temp.style.width=whatsnew.style.width
  209. document.write(tickers[top])
  210. }
  211. //-->
  212. </script>
  213. </span><br>
  214. <!-- Step 3: Finally, add the below into the <body> tag itself, like this: -->
  215. <body onLoad="begin()">
  216.  
  217. <!-- END OF SCRIPT -->
  218. <!/PREVIEW>
  219.  
  220. <!RELATED>NONE<!/RELATED>